home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / util / sys / PoolMem.readme < prev    next >
Encoding:
Text File  |  1998-01-06  |  9.2 KB  |  226 lines

  1. Short:    Memory defragmentizer/AllocP superset
  2. Author:   thor@math.tu-berlin.de (Thomas Richter)
  3. Uploader: thor@math.tu-berlin.de (Thomas Richter)
  4. Version:  1.19.1
  5. Type:     util/sys
  6.  
  7. ______________________________________________________________________________
  8.  
  9. Changed the name of the DefragMeter to FragMeter because that makes more
  10. sense. Added a chunk count to this program. PoolMem itself unchanged.
  11. ______________________________________________________________________________
  12.  
  13. About PoolMem:
  14.     
  15.     If you run a lot of programs without resetting the system, you'll
  16. usually find that the main memory of the computer is getting "messed up",
  17. split in lots of tiny memory "snippets" that are more or less useless due to
  18. their tinyness. It may happen that you can't start an application even though
  19. enough memory is available - because this memory is too fragmentated to
  20. be of any use.
  21.  
  22. That's the point where PoolMem tries to help you: It manages the main memory
  23. in a way such that it can't get fragmentated too easely. It replaces also
  24. the function of AllocP, which is therefore obsolete.
  25.  
  26. ______________________________________________________________________________
  27.  
  28. Installation and Usage:
  29.  
  30.     Copy the PoolMem program in this archive to the C: directory of your
  31. system partition. Add the following line to your startup-sequence:
  32.  
  33. PoolMem >NIL:
  34.  
  35.  
  36. You might also want to install "PatchRAM" which is included in this archive,
  37. too. It modifies the system RAM disk in a way that avoids memory 
  38. fragmentation, too. Another bonus is that the RAM disk will show its true
  39. size from now on, i.e. it won't be no longer 100% full.
  40.  
  41.  
  42. To remove PoolMem later on, open a shell window and enter
  43.  
  44. PoolMem remove
  45.  
  46. ______________________________________________________________________________
  47.  
  48. Compatibility:
  49.  
  50.     There are a couple of relatively deep patches of the memory system
  51. that shouldn't be run together with PoolMem:
  52.  
  53. - SetPatch:    The 68040 library which is loaded by this program seems
  54.         to allocate the MMU tables in a strange way incompatible
  55.         to the scratch list of PoolMem. Easy solution: run
  56.         PoolMem after SetPatch.
  57. - MemSniff:    (The THOR MungWall replacement)    Patches deep into the memory
  58.         allocation routines, too deep for PoolMem.
  59.  
  60. I guess that's all for now...
  61.  
  62. ______________________________________________________________________________
  63.  
  64. Theory of operation:
  65.  
  66.     PoolMem splits all available memory in two blocks: One block is used 
  67. for the small memory snippets (always taken from there), the other block is used
  68. for huge allocations. This partition of the main memory is dynamic, i.e. each
  69. sub-pool can grow and shrink, depending on the memory requirements.
  70.  
  71. The "public/ANY" memory gets a special treatment. PoolMem manages a "scratch"
  72. list for tiny memory blocks taken from there. Instead of taking these tiny
  73. memory blocks always from the main memory, they are taken from this (global,
  74. though) memory pool and put back into this pool if they get freed. A special
  75. garbage collection task cleans this "scratch list" from time to time, or if
  76. it overruns. The main profit is taken from the layers.library, which uses to
  77. allocate tons of tiny snippets and is therefore the main cause for memory
  78. fragmentation.
  79.  
  80. The "chip" memory is treated a bit different. It's also split into two 
  81. distinct memory pools (small and large), but memory from the large pool
  82. is allocated in reverse direction; this happens for two reasons: First, it
  83. helps to keep the memory defragmentated, so the big pool can't run that
  84. easely into the small pool. Second, it works around a hardware bug of my
  85. computer (the refresh of the high end chip memory in my computer seems to
  86. be a bit buggy - some bits tend to flip if they aren't frequently accessed,
  87. for example by the DMA processor as display memory.)
  88.  
  89. For details about the PatchRAM program, check its readme file. As I said, if
  90. you run PoolMem, you're supposed to run PatchRAM as well. It helps PoolMem
  91. a lot in its job!
  92.  
  93. _________________________________________________________________________________
  94.  
  95. Additional programs:
  96.  
  97. The PoolMem program is still in a somewhat experimental stage, even though
  98. it's running stable for my system for more than two years now - I won't
  99. expect any serious bugs, though.
  100. However, if you like to see how PoolMem works and if it has any effects, I
  101. provided several extra programs:
  102.  
  103. ShowMem:        Shows the allocated/free memory in a graphical over-
  104.             view. For details, check the ShowMem readme and its
  105.             guide. (Available separately as well)
  106.  
  107. PatchRAM:        Modifies and improves the RAM disk. Shows the correct
  108.             size of the RAM drive, improves the memory allocation
  109.             sheme of it as well. Should be run together with
  110.             PoolMem. For details, check the guide of PatchRAM.
  111.  
  112. FragMeter:        Calculates the fragmentation of your memory. The
  113.             output is given separately for each memory type.
  114.             A 100% defragmentation indicates that all the free
  115.             memory is messed up in tiny blocks of eight bytes
  116.             each (maximal defragmentation).
  117.             A Shannon-type approach is used to measure the
  118.             defragmentation (the algorithm calculates the
  119.             Shannon entropy of the memory blocks with the formula
  120.             sum += log(chunk->mc_Bytes/total)
  121.             If you've a better approach for measuring the
  122.             fragmentation, lemme now. This here seems at least
  123.             reasonable for me as a theoretical physicst... ;-)
  124.             
  125.             This program can be used to test the efficency of
  126.             PoolMem. My measurements indicate that the entropy is
  127.             about halved.
  128.  
  129. MemoryMess:        A program that tries to fragmentate the main memory
  130.             as worse as possible by allocating and freeing memory
  131.             in random order. Can be used together with the 
  132.             FragMeter to measure the efficiency of PoolMem or
  133.             with ShowMem to watch PoolMem at its job. Can be
  134.             canceled safely with ^C (Control-C).
  135.  
  136. If you've ideas how to improve PoolMem, lemme know....
  137.  
  138. ______________________________________________________________________________
  139.  
  140.                         The THOR-Software Licence
  141.  
  142.  
  143. This License applies to the computer programs known as "PoolMem", "ShowMem",
  144. "FragMeter", "MemoryMess" and "ShowMem".
  145. The "Program", below, refers to such program.
  146.  
  147.  
  148. The programs and files in this distribution are freely distributable
  149. under the restrictions stated below, but are also Copyright (c)
  150. Thomas Richter.
  151.  
  152.  
  153. Distribution of the Program by a commercial organization without written
  154. permission from the author to any third party is prohibited if any payment
  155. is made in connection with such distribution, whether directly
  156. (as in payment for a copy of the Program) or indirectly (as in payment
  157. for some service related to the Program, or payment for some product
  158. or service that includes a copy of the Program "without charge";
  159. these are only examples, and not an exhaustive enumeration of prohibited
  160. activities). However, the following methods of distribution involving
  161. payment shall not in and of themselves be a violation of this restriction:
  162.  
  163.  
  164. (i) Posting the Program on a public access information storage and
  165. retrieval service for which a fee is received for retrieving information
  166. (such as an on-line service), provided that the fee is not
  167. content-dependent (i.e., the fee would be the same for retrieving the same
  168. volume of information consisting of random data).
  169.  
  170.  
  171.  
  172. (ii) Distributing the Program on a CD-ROM, provided that the files
  173. containing the Program are reproduced entirely and verbatim on such
  174. CD-ROM, and provided further that all information on such CD-ROM be
  175. redistributable for non-commercial purposes without charge.
  176.  
  177.  
  178.  
  179. Everything in this distribution must be kept together, in original
  180. and unmodified form.
  181.  
  182.  
  183.  
  184.  
  185. Limitations.
  186.  
  187. THE PROGRAM IS PROVIDED TO YOU "AS IS," WITHOUT WARRANTY. THERE IS NO
  188. WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  189. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  190. PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE
  191. RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
  192. THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  193. SERVICING, REPAIR OR CORRECTION.
  194.  
  195.  
  196.  
  197. IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE ALL FILES CONTAINED IN
  198. THIS ARCHIVE.
  199.  
  200. ______________________________________________________________________________
  201.  
  202. Have fun,
  203.     Thomas        December 1997
  204.  
  205.  
  206. ============================= Archive contents =============================
  207.  
  208. Original  Packed Ratio    Date     Time    Name
  209. -------- ------- ----- --------- --------  -------------
  210.     4952    3466 30.0% 05-Dec-97 22:42:30 +FragMeter
  211.     9432    4583 51.4% 29-Nov-97 20:22:46 +MemoryMess
  212.     1140     788 30.8% 29-Nov-97 20:23:12 +PatchRAM
  213.     2949    1454 50.6% 29-Nov-97 20:23:12 +PatchRAM.readme
  214.      856     375 56.1% 29-Nov-97 20:43:26 +PatchRAM.readme.info
  215.     4072    2679 34.2% 29-Nov-97 15:39:22 +PoolMem
  216.     8305    3597 56.6% 05-Dec-97 22:48:58 +PoolMem.readme
  217.      856     375 56.1% 29-Nov-97 20:43:24 +PoolMem.readme.info
  218.     3256    2089 35.8% 29-Nov-97 20:23:40 +ShowMem
  219.     4415    2095 52.5% 29-Nov-97 20:23:40 +ShowMem.guide
  220.      537     286 46.7% 29-Nov-97 20:43:24 +ShowMem.guide.info
  221.     1038     323 68.8% 29-Nov-97 20:43:24 +ShowMem.info
  222.     9526    5060 46.8% 29-Nov-97 20:23:36 +ShowMem.pic
  223.      540     312 42.2% 29-Nov-97 20:23:36 +ShowMem.readme
  224. -------- ------- ----- --------- --------
  225.    51874   27482 47.0% 08-Dec-97 19:21:54   14 files
  226.